package pack0603;

import java.util.Scanner;

public class DemoB {
    public static void main(String[] args) {
      Scanner zhong= new Scanner(System.in);
        System.out.println("输入八位数: ");
        int a=zhong.nextInt();
        int year = a/10000;
        int moth =  a/100%100;
        int day = a%100;
        System.out.println(year);
        System.out.println(moth);
        System.out.println(day);
        int resday=0;
        boolean flag =(year/4==0&&year/100==0||year/400==0);
        switch (moth){
            case 1 :
                resday =day;
                break;
            case 2:
                resday =31+day;
                break;
            case 3:
                resday =31+ (flag?29:28) +day;
                break;
            case 4:
                resday =31+ (flag?29:28) +31+day;
                break;
            case 5:
                resday =31+ (flag?29:28) +31+30+day;
                break;
            case 6:
                resday =31+ (flag?29:28) +31+30+31+day;
                break;
            case 7:
                resday =31+ (flag?29:28) +31+30+31+30+day;
                break;
            case 8:
                resday =31+ (flag?29:28) +31+30+31+30+31+day;
                break;
            case 9:
                resday =31+ (flag?29:28) +31+30+31+30+31+31+day;
                break;
            case 10:
                resday =31+ (flag?29:28) +31+30+31+30+31+31+30+day;
                break;
            case 11:
                resday =31+ (flag?29:28) +31+30+31+30+31+31+30+31+day;
                break;
            case 12:
                resday =31+ (flag?29:28) +31+30+31+30+31+31+30+31+30+day;
                break;
        }
        System.out.println(resday);
    }

}
